package ooptest;

public class Draw {
    private int height;

    public void setHeight(int height) {
        this.height = height;
    }

    public void sanjiaoxing(){
        for (int i=0;i<height;i++){
            for (int j=0;j<=i;j++){
                System.out.println("*");
            }
            System.out.println();
        }
    }
    public void juxing(){
        for (int i=0;i<height;i++){
            for(int j=0;j<height;j++){
                System.out.println("*");
            }
            System.out.println();
        }
    }
    public void pingxingsibianxing(){
        for (int i=0;i<height;i++){
            for (int j=0;j<i;j++){
                System.out.println(" ");
            }
            for (int k=0;k<height;k++){
                System.out.println("*");
            }
            System.out.println();
        }
    }

    public static void main(String[] args) {
        Draw d=new Draw();
        d.setHeight(4);
        d.sanjiaoxing();
        d.juxing();
        d.pingxingsibianxing();
    }
}
